import pandas as pd
import numpy as np
from castle.common import GraphDAG
from castle.metrics import MetricsDAG

if __name__ == '__main__':
    file_index = 25
    path = './dataset/'
    true_causal_matrix = np.load(path + str(file_index) + '/DAG.npy')
    est_causal_matrix = np.load(path + str(file_index) + '/est1.npy')
    GraphDAG(est_causal_matrix, true_causal_matrix)
    g_score = MetricsDAG(est_causal_matrix, true_causal_matrix).metrics['gscore']
    print('g-score:%.3f' % g_score)
